#include "Env.h"

#include <string.h>
#include <fan-llvm/core/Core.h>
#include "Type.h"
#include "UnsupportedErr.h"


Type* Env_classType = NULL;
VTable* Env_classVTable = NULL;


/**********************************************
 *
 * Methods and fields
 *
 **********************************************/


/* Void make(Env parent) */
void Env_make_0(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.make not implemented yet"));
}


/* Void make(Env parent) */
void Env_make(Env* self, Env* parent)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.make not implemented yet"));
}


/* Env cur() */
Env* Env_cur(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.cur not implemented yet"));
}


/* Env? parent() */
Env* Env_parent(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.parent not implemented yet"));
}


/* Str platform() */
Str* Env_platform(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.platform not implemented yet"));
}


/* Str os() */
Str* Env_os(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.os not implemented yet"));
}


/* Str arch() */
Str* Env_arch(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.arch not implemented yet"));
}


/* Str runtime() */
Str* Env_runtime(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.runtime not implemented yet"));
}


/* Int idHash(Obj? obj) */
Int Env_idHash(Env* self, NullableObj obj)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.idHash not implemented yet"));
}


/* Str[] args() */
List* Env_args(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.args not implemented yet"));
}


/* [Str:Str] vars() */
Map* Env_vars(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.vars not implemented yet"));
}


/* [Str:Obj] diagnostics() */
Map* Env_diagnostics(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.diagnostics not implemented yet"));
}


/* Void gc() */
void Env_gc(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.gc not implemented yet"));
}


/* Str host() */
Str* Env_host(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.host not implemented yet"));
}


/* Str user() */
Str* Env_user(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.user not implemented yet"));
}


/* InStream in() */
InStream* Env_in(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.in not implemented yet"));
}


/* OutStream out() */
OutStream* Env_out(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.out not implemented yet"));
}


/* OutStream err() */
OutStream* Env_err(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.err not implemented yet"));
}


/* File homeDir() */
File* Env_homeDir(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.homeDir not implemented yet"));
}


/* File workDir() */
File* Env_workDir(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.workDir not implemented yet"));
}


/* File tempDir() */
File* Env_tempDir(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.tempDir not implemented yet"));
}


/* File? findFile(Uri uri, Bool checked) */
File* Env_findFile_1(Env* self, Uri* uri)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.findFile not implemented yet"));
}


/* File? findFile(Uri uri, Bool checked) */
File* Env_findFile(Env* self, Uri* uri, Bool checked)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.findFile not implemented yet"));
}


/* File[] findAllFiles(Uri uri) */
List* Env_findAllFiles(Env* self, Uri* uri)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.findAllFiles not implemented yet"));
}


/* File? findPodFile(Str podName) */
File* Env_findPodFile(Env* self, Str* podName)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.findPodFile not implemented yet"));
}


/* Str[] findAllPodNames() */
List* Env_findAllPodNames(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.findAllPodNames not implemented yet"));
}


/* Type compileScript(File f, [Str:Obj]? options) */
Type* Env_compileScript_1(Env* self, File* f)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.compileScript not implemented yet"));
}


/* Type compileScript(File f, [Str:Obj]? options) */
Type* Env_compileScript(Env* self, File* f, Map* options)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.compileScript not implemented yet"));
}


/* Str[] index(Str key) */
List* Env_index(Env* self, Str* key)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.index not implemented yet"));
}


/* [Str:Str] props(Pod pod, Uri uri, Duration maxAge) */
Map* Env_props(Env* self, Pod* pod, Uri* uri, Duration* maxAge)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.props not implemented yet"));
}


/* Str? config(Pod pod, Str key, Str? def) */
Str* Env_config_2(Env* self, Pod* pod, Str* key)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.config not implemented yet"));
}


/* Str? config(Pod pod, Str key, Str? def) */
Str* Env_config(Env* self, Pod* pod, Str* key, Str* def)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.config not implemented yet"));
}


/* Str? locale(Pod pod, Str key, Str? def, Locale locale) */
Str* Env_locale_2(Env* self, Pod* pod, Str* key)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.locale not implemented yet"));
}


/* Str? locale(Pod pod, Str key, Str? def, Locale locale) */
Str* Env_locale_3(Env* self, Pod* pod, Str* key, Str* def)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.locale not implemented yet"));
}


/* Str? locale(Pod pod, Str key, Str? def, Locale locale) */
Str* Env_locale(Env* self, Pod* pod, Str* key, Str* def, Locale* locale)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.locale not implemented yet"));
}


/* Void exit(Int status) */
void Env_exit_0(Env* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.exit not implemented yet"));
}


/* Void exit(Int status) */
void Env_exit(Env* self, Int status)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.exit not implemented yet"));
}


/* Void addShutdownHook(|->Void| hook) */
void Env_addShutdownHook(Env* self, Func* hook)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.addShutdownHook not implemented yet"));
}


/* Bool removeShutdownHook(|->Void| hook) */
Bool Env_removeShutdownHook(Env* self, Func* hook)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Env.removeShutdownHook not implemented yet"));
}


/**********************************************
 *
 * Type-system functions
 *
 **********************************************/


Type* Env_initType(void)
{
  if (Env_classType == NULL)
  {
    Type* baseType = Obj_initType();
    VTable* vtable = Env_initVTable();
    Type* type = Type_new("Env", baseType, vtable, sizeof(Env), sizeof(EnvVTable));
    Type_registerCtorImplementation(type, "make", Env_make_0, 0);
    Type_registerCtorImplementation(type, "make", Env_make, 1);
    Type_registerMethodImplementation(type, "addShutdownHook", Env_addShutdownHook, 1);
    Type_registerMethodImplementation(type, "arch", Env_arch, 0);
    Type_registerMethodImplementation(type, "args", Env_args, 0);
    Type_registerMethodImplementation(type, "compileScript", Env_compileScript_1, 1);
    Type_registerMethodImplementation(type, "compileScript", Env_compileScript, 2);
    Type_registerMethodImplementation(type, "config", Env_config_2, 2);
    Type_registerMethodImplementation(type, "config", Env_config, 3);
    Type_registerMethodImplementation(type, "cur", Env_cur, 0);
    Type_registerMethodImplementation(type, "diagnostics", Env_diagnostics, 0);
    Type_registerMethodImplementation(type, "err", Env_err, 0);
    Type_registerMethodImplementation(type, "exit", Env_exit_0, 0);
    Type_registerMethodImplementation(type, "exit", Env_exit, 1);
    Type_registerMethodImplementation(type, "findAllFiles", Env_findAllFiles, 1);
    Type_registerMethodImplementation(type, "findAllPodNames", Env_findAllPodNames, 0);
    Type_registerMethodImplementation(type, "findFile", Env_findFile_1, 1);
    Type_registerMethodImplementation(type, "findFile", Env_findFile, 2);
    Type_registerMethodImplementation(type, "findPodFile", Env_findPodFile, 1);
    Type_registerMethodImplementation(type, "gc", Env_gc, 0);
    Type_registerMethodImplementation(type, "homeDir", Env_homeDir, 0);
    Type_registerMethodImplementation(type, "host", Env_host, 0);
    Type_registerMethodImplementation(type, "idHash", Env_idHash, 1);
    Type_registerMethodImplementation(type, "in", Env_in, 0);
    Type_registerMethodImplementation(type, "index", Env_index, 1);
    Type_registerMethodImplementation(type, "locale", Env_locale_2, 2);
    Type_registerMethodImplementation(type, "locale", Env_locale_3, 3);
    Type_registerMethodImplementation(type, "locale", Env_locale, 4);
    Type_registerMethodImplementation(type, "os", Env_os, 0);
    Type_registerMethodImplementation(type, "out", Env_out, 0);
    Type_registerMethodImplementation(type, "parent", Env_parent, 0);
    Type_registerMethodImplementation(type, "platform", Env_platform, 0);
    Type_registerMethodImplementation(type, "props", Env_props, 3);
    Type_registerMethodImplementation(type, "removeShutdownHook", Env_removeShutdownHook, 1);
    Type_registerMethodImplementation(type, "runtime", Env_runtime, 0);
    Type_registerMethodImplementation(type, "tempDir", Env_tempDir, 0);
    Type_registerMethodImplementation(type, "user", Env_user, 0);
    Type_registerMethodImplementation(type, "vars", Env_vars, 0);
    Type_registerMethodImplementation(type, "workDir", Env_workDir, 0);
    Env_classType = type;
    Env_initStatic();
  }
  return Env_classType;
}


VTable* Env_initVTable(void)
{
  if (Env_classVTable == NULL)
  {
    VTable* vtable = memoryAlloc(sizeof(EnvVTable));
    memcpy(vtable, Obj_initVTable(), sizeof(FanObjVTable));
    ((EnvVTable*)vtable)->addShutdownHook = Env_addShutdownHook;
    ((EnvVTable*)vtable)->args = Env_args;
    ((EnvVTable*)vtable)->compileScript_1 = Env_compileScript_1;
    ((EnvVTable*)vtable)->compileScript = Env_compileScript;
    ((EnvVTable*)vtable)->config_2 = Env_config_2;
    ((EnvVTable*)vtable)->config = Env_config;
    ((EnvVTable*)vtable)->diagnostics = Env_diagnostics;
    ((EnvVTable*)vtable)->err = Env_err;
    ((EnvVTable*)vtable)->exit_0 = Env_exit_0;
    ((EnvVTable*)vtable)->exit = Env_exit;
    ((EnvVTable*)vtable)->findAllFiles = Env_findAllFiles;
    ((EnvVTable*)vtable)->findAllPodNames = Env_findAllPodNames;
    ((EnvVTable*)vtable)->findFile_1 = Env_findFile_1;
    ((EnvVTable*)vtable)->findFile = Env_findFile;
    ((EnvVTable*)vtable)->findPodFile = Env_findPodFile;
    ((EnvVTable*)vtable)->gc = Env_gc;
    ((EnvVTable*)vtable)->homeDir = Env_homeDir;
    ((EnvVTable*)vtable)->host = Env_host;
    ((EnvVTable*)vtable)->in = Env_in;
    ((EnvVTable*)vtable)->index = Env_index;
    ((EnvVTable*)vtable)->locale_2 = Env_locale_2;
    ((EnvVTable*)vtable)->locale_3 = Env_locale_3;
    ((EnvVTable*)vtable)->locale = Env_locale;
    ((EnvVTable*)vtable)->out = Env_out;
    ((EnvVTable*)vtable)->props = Env_props;
    ((EnvVTable*)vtable)->removeShutdownHook = Env_removeShutdownHook;
    ((EnvVTable*)vtable)->tempDir = Env_tempDir;
    ((EnvVTable*)vtable)->user = Env_user;
    ((EnvVTable*)vtable)->vars = Env_vars;
    ((EnvVTable*)vtable)->workDir = Env_workDir;
    Env_classVTable = vtable;
  }
  return Env_classVTable;
}


void Env_initStatic(void)
{
}
